<?php
header('Content-Type:text/html;Charset=UTF-8');

@$name = $_REQUEST['name'];
@$price = $_REQUEST['price'];

if(empty($price)){
	
	die(json_encode(array('status'=>false,'info'=>'修改失败！')));
}

require 'lib/db.php';

@$flag = dbUpdate('update entry set price=:price where name=:name',array('name'=>$name,'price'=>$price));

if(!$flag){
	die(json_encode(array('status'=>false,'info'=>'修改失败！')));
}

@$entry = dbSelect('select id,name price from entry where name=:name',array('name'=>$name,'price'=>$price));

echo json_encode(array('status'=>true,'price'=>$entry['price']));
?>




